package org.springblade.modules.admin.vo.elevator;

import cn.hutool.core.convert.Convert;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springblade.core.tenant.mp.TenantEntity;
import org.springblade.modules.admin.vo.parts.PartWordUrlVo;

import java.util.Date;
import java.util.List;

/**
 * @author zcc
 * @version 1.0
 * @date 2024/12/4 17:35
 */
@Data
public class ElevatorDetailVo extends TenantEntity {

	/**
	 * 地址冗余：方便前端获取
	 */
	private String name;

	/**
	 * 创建时间（新），避免和原有冲突
	 */
	private Date createTimeNew;


	private String elevatorId;

	private String securityGuardName;

	private String supportingPower;

	private String madeName;

	/**
	 * 品种设备
	 */
	@TableField(value = "varieties_equipment")
	private String varietiesEquipment;

	/**
	 * 单位内编号
	 */
	@TableField(value = "register_number")
	private String registerNumber;

	/**
	 * 登记证编号
	 */
	@TableField(value = "equipment_register_number")
	private String equipmentRegisterNumber;

	/**
	 * 保险结束时间
	 */
	@TableField(value = "insurance_end_date")
	private Date insuranceEndDate;

	/**
	 * 层
	 */
	@TableField(value = "floor_high")
	private String floorHigh;

	/**
	 * 门
	 */
	@TableField(value = "door")
	private String door;

	/**
	 * 站
	 */
	@TableField(value = "stand")
	private String stand;

	/**
	 * 登记机关
	 */
	@TableField(value = "registration_authority")
	private String registrationAuthority;

	/**
	 * 检验机构
	 */
	@TableField(value = "certification_body")
	private String certificationBody;

	/**
	 * 型号
	 */
	@TableField(value = "model_number")
	private String modelNumber;

	/**
	 * 出厂型号
	 */
	@TableField(value = "factory_number")
	private String factoryNumber;

	/**
	 * 额定速度
	 */
	@TableField(value = "speed")
	private String speed;

	/**
	 * 制造日期
	 */
	@TableField(value = "made_date")
	@JsonFormat(pattern = "yyyyMM", timezone = "GMT+8")
	private Date madeDate;

	/**
	 * 启用时间
	 */
	@TableField(value = "start_date")
	@JsonFormat(pattern = "yyyyMM", timezone = "GMT+8")
	private Date startDate;

	/**
	 * 控制方式
	 */
	@TableField(value = "control_mode")
	private String controlMode;

	/**
	 * 限速器编号
	 */
	@TableField(value = "speed_governor_number")
	private String speedGovernorNumber;

	/**
	 * 限速器出厂编号编号
	 */
	@TableField(value = "speed_governor_factory_number")
	private String speedGovernorFactoryNumber;

	/**
	 * 电梯详细位置
	 */
	@TableField(value = "elevator_address")
	private String elevatorAddress;

	/**
	 * 用途分类
	 */
	@TableField(value = "elevator_use_type")
	private Long elevatorUseType;

	/**
	 * 提升高度
	 */
	@TableField(value = "hoist_height")
	private String hoistHeight;

	/**
	 * 生产工号
	 */
	@TableField(value = "manufacture_no")
	private String manufactureNo;

	/**
	 * 合格证号
	 */
	@TableField(value = "cert_no")
	private String certNo;

	/**
	 * 电梯用途 0-公用，1-私用
	 */
	@TableField(value = "use_type")
	private Integer useType;

	/**
	 * 经度
	 */
	@TableField(value = "longitude")
	private String longitude;

	/**
	 * 纬度
	 */
	@TableField(value = "latitude")
	private String latitude;

	/**
	 * 电梯标签
	 */
	@TableField(value = "elevator_label")
	private String elevatorLabel;

	/**
	 * 电梯别名
	 */
	@TableField(value = "elevator_alias")
	private String elevatorAlias;

	@TableField(exist = false)
	private String buildingName;

	@TableField(exist = false)
	private String address;

	/**
	 * 电梯唯一识别码
	 */
	@TableField(value = "elevator_num")
	private String elevatorNum;

	@TableField(exist = false)
	private String driveModeName;

	@ApiModelProperty("识别代码贴纸")
	@TableField(typeHandler = JacksonTypeHandler.class)
	private List<PartWordUrlVo> elevatorNumImg;

	@ApiModelProperty("识别代码贴纸更新时间")
	private Date elevatorNumImgDate;

	@ApiModelProperty("出厂日期")
	private Date factoryDate;


	/**
	 * 电梯id
	 */
	@TableField(exist = false)
	private String elevatorPlusId;

	@ApiModelProperty("电梯品牌")
	private String brandName;

	@ApiModelProperty("电梯品牌id")
	private String brandId;

	public void setElevatorId(String elevatorId) {
		this.elevatorId = Convert.toStr(elevatorId, "");
		;
		this.elevatorPlusId = Convert.toStr(elevatorId, "");
	}
}
